This invention relates to an image processing method and apparatus to be applied to pattern recognition in factory automation and the like, and more particularly, to an image processing method and apparatus for performing pattern matching between an input image and a reference image or template by correlating between the two images.
In one of the applications of an image processing apparatus, an input image having images of various patterns is compared with a reference image of predetermined pattern (hereafter xe2x80x9ctemplatexe2x80x9d) by a pattern matching technique for finding the bast match therebetween. The search is carried out by comparing the template to every possible sub-block of the input image with the same dimensions as the template. This search continues until the entire input image has been scanned and evaluated.
By matching the input image to the template, specific objects or targets which are designated in the template can be identified within the input image. This ability to identify specific objects within the input image which have been previously been designated within a template is quite useful in a number of applications, including robotic control and other machine vision applications, automated inspection systems, automated surveillance systems and medical imagery applications.
A number of image correlation and image detection methods have been developed to identify previously designated objects within an input image. These conventional image detection and correlation systems still suffer from several deficiencies. For example, many conventional image detection methods require significant amount of data processing and computation in order to effectively compare the input image with the template or reference image. Thus, image detection systems based upon these conventional detection methods may require a significant amount of time in order to compare the input image with the template and to identify the designated object within in the input image.
Therefore, it is an object of the present invention to provide an image processing apparatus and method for detecting pattern matching between an input image and a reference image (template) within a short period of time.
It is another object of the present invention to provide an image processing apparatus which performs a pattern matching procedure between an input image and a template image after compressing the input and template images.
It is a further object of the present invention to provide an image pattern matching method which includes a plurality of pattern matching modes having different degree of compression ratio and supplemental pattern matching modes.
It is a further object of the present invention to provide an image pattern matching apparatus incorporating parallel processing techniques such as vector processing memory banldng and multiple parallel functional units to achieve high speed performance.
In the present invention, an image processing apparatus for detecting pattern matching between an input image and a template image includes a first memory for storing a reference pattern as a template, a second memory for storing an input image for which pattern matching with the template is to be detected, means for compressing the template from the first memory and the input image from the second memory by a predetermined compression ratio, a compressed data memory for storing the compressed input image and the compressed template from the compressing means, a main processor for computing inter-correlation between the compressed input image and the compressed template by scaning the compressed input image for each sub-block thereof and determining a location of the compressed input mage showing a best match in a current pattern matching mode. The current pattern matching mode is one of several pattern matching modes with different degrees of compression ratio involved in the compression means and the inter-correlation is determined through two or more pattern matching modes in the order from a higher compression ratio to a lower compression ratio.
Another aspect of the present invention is an image processing method for detecting a pattern match between the input image and the template. The method includes the steps of storing a reference pattern in a first memory as a template, storing an input image for which pattern matching with the template is to be detected in a second memory, compressing the template from the first memory and the input image from the second memory by a predetermined compression ratio, storing the compressed input image and the compressed template from the compressing means in a compressed data memory; and computing inter-correlation between the compressed input image and the compressed template by scanning the compressed input image for each sub-block thereof and determining a location of the compressed input mage showing a best match in a current pattern matching mode. The current pattern matching mode is one of plural pattern matching modes with different degrees of compression ratio involved in the compression means and the inter-correlation is determined through two or more pattern matching modes in the order from higher compression ratio to lower compression ratio.
According to the present invention, the image processing apparatus and method is capable of detecting pattern matching between an input image and a reference image (template) at high speed within a short period of time by incorporating the compression process for the input image and the template before the pattern matching computation. The image processing apparatus performs a pattern matching procedure through a plurality of pattern matching modes with different degree of compression. The pattern matching is performed in the order from the coarse pattern matching mode (higher compression) to the fine pattern matching mode (lower compression and no compression) to decrease an overall time for detecting a best match between the input image and the template. The time required for the compression process is also decreased by incorporating parallel processing techniques such as vector processing memory banking and interleaved memory banking.